package com.dz.core.component.exception;

import com.dz.core.constant.ResCode;

/**
 * 基础业务异常
 * 主要自定义 状态码 的处理
 * @see  ResCode
 * Created by lether on 2016/12/8.
 */
public class DzException extends RuntimeException {

    private ResCode code;
    private String data;

    public DzException(ResCode code){
        super(code.getValue());
        this.setCode(code);

    }


    public DzException(ResCode code,String data){
        super(data);
        this.setCode(code);
        this.setData(data);
    }

    public ResCode getCode() {
        return code;
    }

    public void setCode(ResCode code) {
        this.code = code;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
